package com.jingxi.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.jingxi.common.pojo.EasyUIDataGridResult;
import com.jingxi.common.pojo.JingXiResult;
import com.jingxi.service.ItemParamService;

@Controller
public class ItemParamController {
	
	@Autowired
	private ItemParamService itemParamService;
	
	@RequestMapping("/item/param/list")
	@ResponseBody
	public EasyUIDataGridResult itemParamList(Integer page,Integer rows) {
		return itemParamService.getItemParamList(page, rows);
	}
	
	@RequestMapping("/item/param/query/itemcatid/{cid}")
	@ResponseBody
	public JingXiResult getItemCatParam(@PathVariable long cid) {
		return itemParamService.getParamFromItemCatId(cid);
	}
	
	@RequestMapping("/item/param/save/{cid}")
	@ResponseBody
	public JingXiResult addItemCatParam(@PathVariable long cid,String paramData) {
		return itemParamService.addItemParam(cid, paramData);
	}
	
}
